use std::pin::Pin;
use std::task::{Context, Poll};
use futures::prelude::*;

use crate::platform::{EndpointPipInInner, EndpointPipInImpl};

pub struct EndpointPipIn {
    inner: EndpointPipInImpl
}

impl From<EndpointPipInImpl> for EndpointPipIn {
    fn from(value: EndpointPipInImpl) -> Self {
        Self{
            inner: value
        }
    }
}

impl Stream for EndpointPipIn{
    type Item = Vec<u8>;

    fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
        let rf = self.get_mut().inner.rx();
        Pin::new(rf).poll_next(cx)
    }
}




